package com.daisuxia.web.pojo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;

public class UserContactsVo {
	public static String setContactName(String contactName) {
		if (StringUtils.isNotBlank(contactName)) {
			Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]|[^\\u0000-\\uFFFF]",
					Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
			Matcher emojiMatcher = emoji.matcher(contactName);
			if (emojiMatcher.find()) {
				contactName = emojiMatcher.replaceAll("*");
			}
		}
		return contactName;
	}

	private String mobile;
	private String name;

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = setContactName(name);
	}

	public static void main(String[] args) {
		System.out
				.println(setContactName("This is a smiley \uD83C\uDFA6 face\uD860\uDD5D \uD860\uDE07 \uD860\uDEE2 \uD863\uDCCA \uD863\uDCCD \uD863\uDCD2 \uD867\uDD98"));
	}

}
